import network from '@/utils/network'
import baseUrl from './baseUrl'
const BASE_URL = baseUrl + '/Workflow'

export default {
  getPageList(params) {
    return network.request({
      url: BASE_URL + '/GetPageList',
      method: 'post',
      data: params
    })
  },
  getDetail(id) {
    return network.request({
      url: BASE_URL + '/GetDetail',
      method: 'get',
      params: {
        id
      }
    })
  },
  updateInvoiceFromNuoNuo(data) {
    return network.request({
      url: BASE_URL + '/UpdateInvoiceFromNuoNuo',
      method: 'post',
      data
    })
  },
  save(data) {
    return network.request({
      url: BASE_URL + '/Save',
      method: 'post',
      data
    })
  },
  deleteById(id) {
    return network.request({
      url: BASE_URL + '/deleteById',
      method: 'post',
      data: id
    })
  },
  checkExistByName(name, id) {
    return network.request({
      url: BASE_URL + '/CheckExistByName',
      method: 'get',
      params: {
        name, id
      }
    })
  },
  syncToEs(data) {
    return network.request({
      url: BASE_URL + '/SyncToEs',
      method: 'post',
      data
    })
  },
  returnTask(data) {
    return network.request({
      url: BASE_URL + '/ReturnTask',
      method: 'post',
      data
    })
  },
}